package dk.hewison.client.pages;

import dk.hewison.client.album.AllAlbumPageController;
import static dk.hewison.client.menu.MainMenuController.*;
import dk.hewison.client.mvc.AbstractController;
import dk.hewison.client.mvc.Controller;
import dk.hewison.client.mvc.View;
import dk.hewison.client.panels.ViewFactory;
import dk.hewison.client.slideshow.SlideshowPageController;

/**
 * @author John Hewison
 * @author $LastChangedBy: john.hewison $:  $ $LastChangedDate: 2009-02-07 20:27:07 +0000 (Sat, 07 Feb 2009) $:
 * @version $Revision: 362 $:
 */
public class PageStackController extends AbstractController<Integer> {

    public PageStackController(int id) {
        super(id);
    }


    protected Controller[] initSubControllers() {
        StartPageController startPageController = new StartPageController(START_PAGE);
        AllAlbumPageController allAlbumPageController = new AllAlbumPageController(ALL_ALBUMS);
        SlideshowPageController slideshowPageController = new SlideshowPageController(SLIDESHOW);

        return new Controller[]{startPageController, allAlbumPageController, slideshowPageController};
    }

    public void setModel(Integer model) {
        getView().setModel(model);
    }

    public Integer getModel() {
        return getView().getModel();
    }

    public View<Integer> createView() {
        return ViewFactory.getInstance().createPageStackView();
    }

}
